<template>
    <div style="padding-right: 5px">{{time}}</div>
</template>

<script>
    import moment from 'moment'
    moment.locale("zh-cn");
    export default {
        name: "timeTop",
        data() {
            return {
                time: "",
                timer:null,
            }
        },
        mounted() {
            this.timer= setInterval(() => {
                this.time = moment().format('llll');
                this.time = this.time+":"+ moment().format('ss');
            }, 1000)
        },
        destroyed() {
            clearInterval(this.timer)
        }
    }
</script>

<style scoped>

</style>